<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }

        div {
            margin: 20px auto;
            border: slateblue solid;
            width: 300px;

        }

        img {
            display: block;
            height: 350px;
        }
    </style>
    <link rel="shortcut icon" href="./img/小金狐.ico" type="image/x-icon">
</head>

<body>
    <div>
        <img src="./img/tu1.jpg" alt="">
    </div>
    <script src='https://cdn.bootcdn.net/ajax/libs/jquery/3.6.0/jquery.min.js'></script>
    <script>
        let p = 0
        let pic = ['./img/tu1.jpg', './img/tu2.jpg', './img/tu3.jpg']
        setInterval(() => {
            p++;
            if (p > 3) {
                p = 0;
            }
            $('img').attr('src', pic[p]);

        }, 2000)
    </script>

</body>

</html>